'use strict';
// 根据表格调整的顺序以及过滤包含重新组成当前模板
angular.module('fbdApp.templateModule')

.filter('testTemplateData', function() {
  return function(array, currentTemp) {
    var main = currentTemp.includes[0];
    var layer = currentTemp['rules'][main]['subset'];
    // layer.includes.
    layer.includes = [];
    layer.require = [];
    array.forEach(function(rule) {
      layer.includes.push(rule.name);
      if (rule.keep != 'filtrate') {
        layer.require.push(rule.name);
      } else {
        layer.after.push(rule.name);
      }
    });
    return currentTemp;
  }
});
